﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UlsStudio.Engine
{
    public class BaseDataStats
    {
        #region Private & Constructors
        private readonly int _totalEntries = 0;
        private readonly int _notFilteredEntries = 0;

        public BaseDataStats(int totalEntries, int notFilteredEntries)
        {
            this._totalEntries = totalEntries;
            this._notFilteredEntries = notFilteredEntries;
        }
        #endregion

        #region Props

        public int TotalRecordsInserted
        {
            get { return _totalEntries; }
        }

        public int TotalRecordsShowByFilter
        {
            get { return _notFilteredEntries; }
        } 

        #endregion
    }

    /// <summary>
    /// Stats for a ULS data set
    /// </summary>
    public class FullDataStatistics : BaseDataStats
    {
        #region Private & Constructors 
        private readonly int _warningEntries = 0;
        private readonly int _verboseEntries = 0;
        private readonly int _infoEntries = 0;
        private readonly int _criticalEntries = 0;
        private readonly int _highEntries = 0;
        private readonly int _unexpectedEntries = 0;
        private readonly int _exceptions = 0;

        public FullDataStatistics(int verboseEntries, int infoEntries, int warningEntries, int highEntries, int criticalEntries, int unexpectedEntries, int exceptionCount, int totalEntries, int notFilteredEntries) 
            : base(totalEntries, notFilteredEntries)
        {
            this._verboseEntries = verboseEntries;
            this._infoEntries = infoEntries;
            this._warningEntries = warningEntries;
            this._highEntries = highEntries;
            this._criticalEntries = criticalEntries;
            this._unexpectedEntries = unexpectedEntries;
            this._unexpectedEntries = unexpectedEntries;
            this._exceptions = exceptionCount;
        }

        #endregion

        #region Props

        public int Exceptions
        {
            get { return _exceptions; }
        } 

        public int VerboseEntries
        {
            get { return _verboseEntries; }
        }

        public int InfoEntries
        {
            get { return _infoEntries; }
        }

        public int WarningEntries
        {
            get { return _warningEntries; }
        }

        public int HighEntries
        {
            get { return _highEntries; }
        }

        public int CriticalEntries
        {
            get { return _criticalEntries; }
        }

        public int UnexpectedEntries
        {
            get { return _unexpectedEntries; }
        }
        #endregion

        /// <summary>
        /// No stats to update - for loading non-ULS files only.
        /// </summary>
        public static FullDataStatistics Empty { get { return new FullDataStatistics(0, 0, 0, 0, 0, 0, 0, 0, 0); } }
    }
}
